% b = bar(U','FaceColor','flat');
% b(1).FaceColor = [0 0.4470 0.7410];
% b(2).FaceColor = [0.8500 0.3250 0.0980];
% b(3).FaceColor = [0.9290 0.6940 0.1250];
% b(4).FaceColor = [0.3010 0.7450 0.9330];
% b(5).FaceColor = [0.4660 0.6740 0.1880];
% b(6).FaceColor = [0.6350 0.0780 0.1840];
clear all
clc
clf
set(gcf,'Position',[100 100 460 400]);
set(gca,'Position',[.16 .12 .80 .74]);
figure_FontSize=8;
set(get(gca,'XLabel'),'FontSize',figure_FontSize,'Vertical','top');
set(get(gca,'YLabel'),'FontSize',figure_FontSize,'Vertical','middle');
set(findobj('FontSize',10),'FontSize',figure_FontSize);
set(findobj(get(gca,'Children'),'LineWidth',0.5),'LineWidth',2);
x=[1 2 3 4 5 6 7 8];

p6=[42663,9712+42663,9712+42663+181,9712+42663+181+2,9712+42663+181+2+1,52559,52559,52559]/52559*100;
p7=[37208,37208+14049,37208+14049+1270,37208+14049+1270+27,37208+14049+1270+27+5,52559,52559,52559]/52559*100;
p8=[33282,33282+15239,33282+15239+3734,33282+15239+3734+288,33282+15239+3734+288+11,33282+15239+3734+288+11+4,33282+15239+3734+288+11+4+1,52559]/52559*100;
p9=[29570,29570+14134,29570+14134+6819,29570+14134+6819+1711,29570+14134+6819+1711+289,29570+14134+6819+1711+289+24,29570+14134+6819+1711+289+8,29570+14134+6819+1711+289+3]/52559*100;

plot(x,p6,'-+b',x,p7,'-ok',x,p8,'-sr',x,p9,'-^g','LineWidth',1); %线性，颜色，标记
axis([1,8,0,105])  %确定x轴与y轴框图大小
set(gca,'XTick',[1:1:8]) %x轴范围1-6，间隔1
set(gca,'YTick',[0:20:110]) %y轴范围0-700，间隔100
legend('P\zeta=0.6','P\zeta=0.7','P\zeta=0.8','P\zeta=0.9')
xlabel('# of Sensing Locations')  %x轴坐标描述
ylabel('Task Coverage (%)') %y轴坐标描述
grid on
% b = bar(x,y_all','FaceColor','flat');
% b(1).FaceColor = [0 0.4470 0.7410];
% b(2).FaceColor = [0.8500 0.3250 0.0980];
% b(3).FaceColor = [0.9290 0.6940 0.1250];
% b(4).FaceColor = [0.4660 0.6740 0.1880];
% 
% axis([0,9,0,50000]);
% xlabel('# of Locations')
% ylabel('# of Times')
% legend('P\zeta=0.6','P\zeta=0.7','P\zeta=0.8','P\zeta=0.9')